#version 430
uniform mat4 u_view;
uniform mat4 u_proj;
uniform mat4 u_model;
uniform sampler2D u_heightmap;
uniform sampler2D u_normal;
uniform sampler2D u_dudv;
uniform float u_scale; //for dem
uniform float u_offset;//for dem
uniform vec3 u_gnd2sun;//normalized.
uniform vec3 u_eyepos;// 
uniform float u_tick;

layout(location = 0) in vec3 position;
layout(location = 1) in vec2 uvheight;
layout(location = 2) in vec2 uvnormal;

out vec2 vary_uvheight;
out vec2 vary_uvnormal;
out float vary_waterheight;
out vec3 vary_px2eye;
out vec4 vary_worldposi;
void main()
{
	vary_waterheight = position.y;
	vary_uvheight = uvheight;
	vary_uvnormal = uvnormal;

	vec4 posi_world = u_model * vec4(position, 1.0);
	vary_worldposi = posi_world;

	vary_px2eye = u_eyepos - posi_world.xyz;
	gl_Position = u_proj * u_view * u_model * vec4(position, 1.0);
}